update asm_sgate_richieste ric
set ric.ric_stato=99,ric.RIC_DATA_FIMM= to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy')
where ric.ric_protocollo = (select distinct protocollo from asm_sgate_estr_dati
 where ric.ric_protocollo=protocollo and esito_sgate is not null
 )
 


 
 
